% fname: routing_xy__topology_8x8__.m
% ./noxim -routing xy -dimx 8 -dimy 8  -sim 10000 -warmup 2000 -size 8 8 -buffer 8 -hs 6 0.2 -hs 7 0.2 -hs 14 0.2 -hs 15 0.2 

function [max_pir, max_throughput, min_delay] = routing_xy__topology_8x8__(symbol)

data = [
%             pir      avg_delay     throughput      max_delay       rpackets         rflits
           0.0018        23.9766       0.015178            230            897           7164
           0.0018         24.703      0.0153402            147            936           7486
           0.0018        21.6942       0.013871            144            873           6991
           0.0018        25.7207       0.014619            176            920           7368
           0.0018        24.8094      0.0144617            213            897           7173
           0.0018        28.6693       0.015834            221           1013           8107
           0.0018        22.7226      0.0147823             92            858           6859
           0.0018        24.1779      0.0142969            121            916           7320
           0.0018         24.292       0.015175            169            911           7284
           0.0018         25.979      0.0151111            282            952           7616
           0.0018        27.5393      0.0155827            163            966           7729
           0.0018        24.8659      0.0149344            123            910           7288
           0.0018        23.9339      0.0148896            113            893           7147
           0.0018        27.9532      0.0151928            272            897           7171
           0.0018        25.1359      0.0154226            172            971           7773
           0.0018        23.7008       0.014582             91            889           7116
           0.0018        22.1866      0.0137227            111            879           7026
           0.0018        24.0674      0.0148433            146            935           7481
           0.0018        25.3053      0.0153226            210            950           7600
           0.0018        24.5813      0.0144199            140            922           7383
           0.0019        24.2192      0.0150307            158            917           7335
           0.0019        25.5823      0.0153633            155            984           7866
           0.0019        28.9486      0.0163671            162           1031           8249
           0.0019        25.5295       0.015293            186            933           7463
           0.0019         26.603      0.0156914            151           1005           8034
           0.0019        24.0901      0.0150879            168            966           7725
           0.0019        26.5602      0.0154127            127            971           7768
           0.0019        23.6611      0.0159333            104            956           7648
           0.0019        24.5256      0.0151391            169            938           7509
           0.0019        24.8418      0.0160594            256            980           7837
           0.0019        26.9395      0.0157254            249            959           7674
           0.0019        24.2513      0.0160875            150            967           7722
           0.0019         33.044      0.0161431            509           1001           8007
           0.0019        25.8041      0.0161708            129            970           7762
           0.0019        28.6834      0.0163668            130            998           7987
           0.0019        24.9507      0.0166107            204           1014           8106
           0.0019        23.5545      0.0159365            162            972           7777
           0.0019        26.3347      0.0156777            174           1004           8027
           0.0019        28.4866      0.0159802            256           1007           8054
           0.0019        24.8196      0.0165496            169            959           7679
            0.002        27.1206      0.0166052            306           1045           8369
            0.002        24.9016      0.0159229            181            955           7643
            0.002         28.416          0.017            175           1036           8296
            0.002        28.7916      0.0170437            149           1022           8181
            0.002        28.0847      0.0165444            245           1027           8206
            0.002        28.1916      0.0169153            344           1049           8390
            0.002         28.355      0.0161492            208           1000           8010
            0.002        28.7888       0.016748            179           1056           8441
            0.002        27.2486      0.0167599            210           1058           8447
            0.002        24.3632      0.0157798            169            994           7953
            0.002        27.2478      0.0165328            231           1009           8068
            0.002        27.9877      0.0165527            196           1060           8475
            0.002         31.873      0.0159863            238           1024           8185
            0.002        26.0804      0.0168649            132           1045           8365
            0.002        25.5133      0.0170363            199           1056           8450
            0.002        27.4332      0.0170729            205           1025           8195
            0.002        29.6082       0.017025            219           1021           8172
            0.002        27.1873      0.0167137            260           1036           8290
            0.002        29.5639      0.0162461            282           1041           8318
            0.002        31.9872      0.0159375            629           1017           8160
           0.0021        32.3477      0.0169921            240           1070           8564
           0.0021        25.4781      0.0167667            129           1006           8048
           0.0021        29.8461      0.0172923            299           1072           8577
           0.0021        30.2368      0.0180278            173           1136           9086
           0.0021        25.7038       0.016668            195           1067           8534
           0.0021        24.2749      0.0160371            138           1026           8211
           0.0021        27.8279      0.0177131            202           1081           8644
           0.0021        27.3542      0.0169683            161           1070           8552
           0.0021        24.1945      0.0169093            192           1049           8387
           0.0021        28.3202      0.0176391            234           1093           8749
           0.0021         31.324      0.0175516            204           1105           8846
           0.0021        28.3649      0.0168164            232           1077           8610
           0.0021        26.8242      0.0176352            139           1075           8606
           0.0021         29.484      0.0171333            253           1029           8224
           0.0021        30.2544      0.0175328            193           1069           8556
           0.0021        37.2763      0.0179262            326           1093           8748
           0.0021        26.3507      0.0160922            165            981           7853
           0.0021        31.5962      0.0166465            385           1065           8523
           0.0021        28.1762      0.0171934            133           1101           8803
           0.0021         24.837      0.0169214            103           1049           8393
           0.0022        34.3765      0.0182031            443           1166           9320
           0.0022        29.5862      0.0170278            250           1073           8582
           0.0022        29.8442      0.0178016            170           1123           8972
           0.0022        37.9983      0.0191168            344           1167           9329
           0.0022        28.8657      0.0181984            180           1147           9172
           0.0022        35.2853      0.0166914            262           1069           8546
           0.0022        29.8778      0.0176726            219           1113           8907
           0.0022        28.2784      0.0183004            179           1135           9077
           0.0022        30.9876      0.0176953            185           1132           9060
           0.0022        31.7467      0.0187604            225           1125           9005
           0.0022         29.353      0.0172183            274           1085           8678
           0.0022        33.3167      0.0180873            382           1140           9116
           0.0022         28.683      0.0181797            232           1164           9308
           0.0022        34.5947      0.0181367            296           1162           9286
           0.0022        28.8989      0.0173262            142           1108           8871
           0.0022        33.0818      0.0182202            292           1149           9183
           0.0022        31.4733      0.0178301            224           1141           9129
           0.0022        30.7055      0.0178566            284           1090           8714
           0.0022        31.6021      0.0175059            339           1121           8963
           0.0022        30.8573      0.0178075            233           1121           8975
           0.0023        33.9069      0.0189918            265           1160           9268
           0.0023        30.0403      0.0181992            215           1166           9318
           0.0023        32.5071      0.0186875            216           1195           9568
           0.0023        33.2804      0.0185117            398           1184           9478
           0.0023        37.2827      0.0185137            333           1185           9479
           0.0023        32.9387      0.0183418            263           1174           9391
           0.0023        30.8152      0.0185496            203           1169           9349
           0.0023        38.9308      0.0182969            467           1171           9368
           0.0023        36.3331      0.0186925            223           1177           9421
           0.0023        29.4517      0.0185575            305           1169           9353
           0.0023         33.816      0.0187722            203           1163           9311
           0.0023        33.6934      0.0188945            259           1210           9674
           0.0023        35.4595       0.018494            535           1147           9173
           0.0023        28.5107      0.0186468            260           1173           9398
           0.0023          33.36      0.0192541            236           1175           9396
           0.0023        38.3951      0.0183203            387           1172           9380
           0.0023        29.7703      0.0191429            165           1206           9648
           0.0023        32.0161      0.0187579            315           1182           9454
           0.0023         34.399      0.0191964            301           1208           9675
           0.0023        37.2236      0.0198979            532           1194           9551
           0.0024        36.2225      0.0197639            250           1245           9961
           0.0024        32.9111      0.0191052            276           1204           9629
           0.0024         37.872      0.0196387            645           1258          10055
           0.0024        45.2911      0.0195079            643           1230           9832
           0.0024         34.368      0.0196786            307           1242           9918
           0.0024        32.4381      0.0182695            250           1171           9354
           0.0024        32.7523      0.0191331            306           1187           9490
           0.0024        33.2097      0.0184102            323           1178           9426
           0.0024        39.2365      0.0185664            319           1188           9506
           0.0024        40.5363      0.0199226            402           1255          10041
           0.0024        34.6297      0.0189206            282           1191           9536
           0.0024        34.9821      0.0191855            320           1228           9823
           0.0024         46.207      0.0196426            597           1256          10057
           0.0024        38.6869       0.019879            269           1252          10019
           0.0024        46.5028      0.0196607            505           1239           9909
           0.0024        43.6906       0.019873            561           1270          10175
           0.0024        49.9208      0.0196537           1087           1200           9591
           0.0024        32.6106      0.0189355            246           1212           9695
           0.0024        41.5921      0.0190254            385           1216           9741
           0.0024        33.6784      0.0188387            293           1166           9344
           0.0025        41.5433      0.0206694            256           1281          10252
           0.0025        40.3347      0.0195312            532           1249          10000
           0.0025        58.7112      0.0203373           1034           1281          10250
           0.0025         35.573      0.0192157            282           1192           9531
           0.0025        54.4502      0.0204435           1039           1266          10140
           0.0025        39.9822      0.0204821            380           1291          10323
           0.0025        39.9702      0.0197083            362           1240           9933
           0.0025        61.5639      0.0213427            602           1323          10586
           0.0025        46.9417      0.0201152            610           1287          10299
           0.0025        48.2019      0.0197897            640           1248           9974
           0.0025        45.5962      0.0203115            365           1278          10237
           0.0025        38.3092      0.0204325            308           1287          10298
           0.0025        44.4883      0.0200742            393           1284          10278
           0.0025        35.0252      0.0192559            278           1232           9859
           0.0025        44.0382      0.0203968            354           1284          10280
           0.0025        44.3084      0.0200726            482           1245           9956
           0.0025        110.974      0.0208115           3152           1269          10156
           0.0025        40.9227      0.0209385            362           1319          10553
           0.0025        47.2655       0.020957            658           1341          10730
           0.0025        55.6542      0.0200337            582           1261          10097
           0.0026        38.1793      0.0193398            245           1238           9902
           0.0026        38.8272      0.0205913            297           1296          10378
           0.0026        72.7035       0.021252           1001           1339          10711
           0.0026        38.0342       0.020752            490           1286          10293
           0.0026        43.3331      0.0206836            371           1324          10590
           0.0026        47.0787      0.0209802            456           1322          10574
           0.0026        54.3351      0.0211133            678           1352          10810
           0.0026        52.9369      0.0207137            580           1283          10274
           0.0026        56.3333      0.0212871            752           1362          10899
           0.0026        53.7222      0.0213711            678           1368          10942
           0.0026        44.9192      0.0213871            366           1325          10608
           0.0026        50.0953      0.0211152            524           1354          10811
           0.0026        88.2238      0.0216812           1770           1300          10407
           0.0026        58.6626      0.0206406           1130           1322          10568
           0.0026        79.5043      0.0216562           1597           1386          11088
           0.0026        62.6385      0.0219345            731           1383          11055
           0.0026        58.7733      0.0201387            714           1288          10311
           0.0026         40.038      0.0208849            234           1317          10526
           0.0026        41.5381      0.0208155            353           1312          10491
           0.0026        48.2651      0.0210195            437           1343          10762
           0.0027          64.82      0.0217163            825           1367          10945
           0.0027        54.3772      0.0215544            780           1336          10691
           0.0027        60.9062      0.0223433            723           1407          11261
           0.0027        118.583      0.0223387           1446           1385          11080
           0.0027        59.0602      0.0215605            477           1379          11039
           0.0027        56.3901      0.0210694            879           1328          10619
           0.0027        79.2583      0.0215898           1671           1382          11054
           0.0027        48.9188      0.0220363            737           1367          10930
           0.0027        81.9517       0.023375           1217           1448          11594
           0.0027        68.0807      0.0224551            636           1437          11497
           0.0027        45.0128      0.0211012            473           1328          10635
           0.0027        69.0636      0.0220937            986           1414          11312
           0.0027        83.6052      0.0223968           1627           1411          11288
           0.0027        162.168      0.0229922           2868           1470          11772
           0.0027        155.959      0.0222044           3884           1398          11191
           0.0027        196.892      0.0222148           4169           1421          11374
           0.0027         77.599      0.0216328           1380           1384          11076
           0.0027        42.2674      0.0211035            297           1350          10805
           0.0027        43.3714      0.0214226            467           1349          10797
           0.0027        147.376      0.0214762           3232           1351          10824
           0.0028         101.73      0.0224414           1496           1435          11490
           0.0028        87.1163      0.0228535           1329           1462          11701
           0.0028          248.3      0.0230195           4580           1473          11786
           0.0028        65.0048      0.0226777            899           1450          11611
           0.0028         93.007        0.02275           1698           1434          11466
           0.0028        228.633       0.023002           6289           1448          11593
           0.0028        76.0766      0.0220352           1986           1410          11282
           0.0028        58.1431      0.0223906           1330           1433          11464
           0.0028        177.472      0.0224141           2476           1435          11476
           0.0028        237.378      0.0225694           5788           1421          11375
           0.0028        106.234      0.0228056           2450           1437          11494
           0.0028        99.1035      0.0218036           1980           1372          10989
           0.0028        99.2098      0.0228457           1164           1463          11697
           0.0028        47.6625      0.0214922            625           1375          11004
           0.0028        65.0358       0.022629            596           1425          11405
           0.0028        109.835      0.0216445           2018           1385          11082
           0.0028        73.9183      0.0218125           1411           1395          11168
           0.0028        61.7414      0.0221758            699           1419          11354
           0.0028        158.418      0.0226953           4108           1453          11620
           0.0028        47.3067      0.0218472            400           1376          11011
           0.0029        58.3459       0.022752            465           1457          11649
           0.0029        73.3801      0.0228262           1119           1460          11687
           0.0029        97.3993      0.0225556           1727           1420          11368
           0.0029        132.284      0.0230605           2470           1477          11807
           0.0029        93.8246      0.0235352           1017           1505          12050
           0.0029          150.8      0.0219922           2342           1407          11260
           0.0029        51.1897      0.0218945            468           1402          11210
           0.0029        85.6195      0.0224141           1085           1435          11476
           0.0029        194.097          0.023           5438           1471          11776
           0.0029        97.8649      0.0229062           1897           1466          11728
           0.0029        71.0995      0.0222793           1118           1427          11407
           0.0029        126.686      0.0231094           3258           1479          11832
           0.0029        262.391       0.023129           4955           1457          11657
           0.0029         199.96      0.0234824           6104           1504          12023
           0.0029        144.336      0.0235273           2311           1508          12046
           0.0029        153.031      0.0239219           3648           1531          12248
           0.0029        146.645      0.0235039           2703           1504          12034
           0.0029        149.772      0.0242897           2761           1530          12242
           0.0029        82.7796      0.0231016            856           1479          11828
           0.0029        197.774       0.023291           3918           1490          11925
            0.003         201.69      0.0228968           5651           1443          11540
            0.003        100.822      0.0230119           2646           1451          11598
            0.003        305.647       0.022957           8119           1469          11754
            0.003        205.578      0.0232344           3949           1487          11896
            0.003        97.0253       0.024254           2077           1504          12030
            0.003         225.73      0.0230273           5519           1473          11790
            0.003        283.905      0.0229062           5866           1466          11728
            0.003        208.771      0.0234375           3804           1500          12000
            0.003        321.935      0.0237659           6652           1498          11978
            0.003        260.843      0.0237246           6308           1518          12147
            0.003        336.904       0.023207           5468           1486          11882
            0.003        188.769      0.0232579           5246           1465          11722
            0.003         216.32        0.02375           5165           1496          11970
            0.003         203.29      0.0231523           5099           1481          11854
            0.003        334.405      0.0239762           6115           1510          12084
            0.003        174.057      0.0235655           5115           1485          11877
            0.003        139.487      0.0234484           4155           1477          11818
            0.003        166.967      0.0246956           5567           1531          12249
            0.003        155.329      0.0231289           3523           1481          11842
            0.003         146.15      0.0229824           3080           1472          11767
           0.0031         280.53      0.0232242           5819           1461          11705
           0.0031        176.611      0.0237871           3842           1522          12179
           0.0031        182.637       0.023334           4632           1494          11947
           0.0031        229.274      0.0246815           5841           1530          12242
           0.0031        219.684      0.0234355           5854           1500          11999
           0.0031        206.558      0.0237031           4768           1515          12136
           0.0031        273.871      0.0238945           6850           1530          12234
           0.0031        189.264      0.0237051           6276           1517          12137
           0.0031         115.48       0.023582           2107           1511          12074
           0.0031        237.527      0.0236836           3420           1515          12126
           0.0031        219.021      0.0236429           6224           1489          11916
           0.0031        214.322      0.0234805           4944           1503          12022
           0.0031        265.503      0.0247339           3506           1532          12268
           0.0031         160.24      0.0246607           3595           1551          12429
           0.0031        296.948      0.0240313           7125           1538          12304
           0.0031        231.157      0.0235254           6801           1506          12045
           0.0031         324.03      0.0237539           5756           1521          12162
           0.0031        294.788      0.0230254           7506           1473          11789
           0.0031        212.399      0.0239395           6919           1532          12257
           0.0031        337.705      0.0240254           6967           1538          12301
           0.0032        397.324      0.0233398           6768           1493          11950
           0.0032        183.558      0.0241543           5132           1546          12367
           0.0032        292.037       0.024252           3954           1552          12417
           0.0032        402.092      0.0241523           6592           1546          12366
           0.0032        263.892      0.0245397           7107           1544          12368
           0.0032         240.63      0.0246094           3398           1575          12600
           0.0032        265.947      0.0237637           8626           1521          12167
           0.0032        246.153      0.0246052           5993           1551          12401
           0.0032        183.143       0.024332           3679           1557          12458
           0.0032        294.187      0.0234902           7223           1504          12027
           0.0032        267.571      0.0239551           5019           1534          12265
           0.0032        276.572      0.0242988           7357           1556          12441
           0.0032        185.448      0.0239883           4753           1535          12282
           0.0032        276.852      0.0239277           5652           1532          12251
           0.0032         202.24      0.0241426           5432           1548          12361
           0.0032        320.338      0.0240139           5231           1512          12103
           0.0032        377.209      0.0241094           7151           1542          12344
           0.0032        364.665      0.0237305           7429           1520          12150
           0.0032        363.451      0.0239563           4555           1509          12074
           0.0032        280.558      0.0247083           4558           1556          12453
           0.0033        371.861      0.0239004           6243           1530          12237
           0.0033        283.092      0.0247559           6793           1583          12675
           0.0033        350.978       0.023832           7082           1526          12202
           0.0033        248.055      0.0238194           6078           1500          12005
           0.0033         269.63       0.024502           6433           1568          12545
           0.0033        433.603      0.0250684           7131           1604          12835
           0.0033        331.601      0.0238008           6337           1522          12186
           0.0033         239.62      0.0247422           6519           1584          12668
           0.0033        293.493      0.0245734           7364           1549          12385
           0.0033        268.733      0.0249551           6706           1597          12777
           0.0033         324.65      0.0243223           7583           1557          12453
           0.0033        233.541      0.0246349           7105           1554          12416
           0.0033         297.77      0.0245234           6936           1569          12556
           0.0033        463.016      0.0238809           8949           1529          12227
           0.0033        233.003      0.0244277           4009           1564          12507
           0.0033        323.102      0.0241071           4743           1519          12150
           0.0033        265.782      0.0246758           4846           1579          12634
           0.0033        334.951      0.0237441           6689           1520          12157
           0.0033        361.717      0.0243633           6594           1560          12474
           0.0033        338.579      0.0241074           6590           1543          12343
           0.0034        290.041      0.0231328           8615           1480          11844
           0.0034        420.293      0.0248887           6658           1592          12743
           0.0034        495.085      0.0249375           7617           1597          12768
           0.0034        302.379      0.0241074           8205           1543          12343
           0.0034        555.306      0.0244531           7858           1564          12520
           0.0034        306.983       0.024832           5963           1590          12714
           0.0034        309.225      0.0246055           6169           1575          12598
           0.0034        337.194       0.024625           6470           1577          12608
           0.0034        364.094      0.0248027           6918           1588          12699
           0.0034        480.408      0.0243574           9450           1559          12471
           0.0034        428.205      0.0246387           8363           1577          12615
           0.0034        478.146      0.0247754           7971           1585          12685
           0.0034        422.689      0.0240645           6193           1540          12321
           0.0034        348.606      0.0251445           6196           1610          12874
           0.0034        233.617      0.0246758           7992           1579          12634
           0.0034        479.674      0.0236348           6399           1513          12101
           0.0034        379.947      0.0240536           8094           1518          12123
           0.0034        402.673      0.0244206           8169           1539          12308
           0.0034        248.686      0.0253672           6670           1623          12988
           0.0034        363.557      0.0257063           6380           1620          12956
           0.0035        568.763      0.0245371           7093           1571          12563
           0.0035        467.997      0.0253552           6710           1600          12779
           0.0035        476.521      0.0250794           6887           1581          12640
           0.0035        518.106      0.0245645           7614           1574          12577
           0.0035        417.644      0.0249141           5952           1595          12756
           0.0035        434.037       0.024996           8500           1575          12598
           0.0035        473.721      0.0248477           7908           1591          12722
           0.0035        455.702      0.0249824           6474           1599          12791
           0.0035        493.841      0.0247617           7474           1585          12678
           0.0035        417.844      0.0241895           7149           1548          12385
           0.0035        486.842      0.0245527           7162           1572          12571
           0.0035        399.888      0.0242969           7781           1557          12440
           0.0035        438.785      0.0246602           7439           1578          12626
           0.0035        333.539      0.0245195           7987           1570          12554
           0.0035        398.954      0.0236328           7536           1513          12100
           0.0035        381.176      0.0248631           6690           1566          12531
           0.0035        529.734      0.0239805           6990           1535          12278
           0.0035        409.434      0.0241508           6458           1522          12172
           0.0035        440.578      0.0246777           8644           1579          12635
           0.0035        434.234      0.0252656           6393           1617          12936
           0.0036         473.29      0.0257837           6244           1625          12995
           0.0036        538.266      0.0246091           8613           1550          12403
           0.0036        658.517      0.0241934           8385           1548          12387
           0.0036        504.434      0.0247559           6099           1583          12675
           0.0036        343.161      0.0247361           6625           1556          12467
           0.0036        428.677      0.0257778           5873           1623          12992
           0.0036        437.088      0.0252778           7899           1594          12740
           0.0036        546.178       0.025506           8529           1581          12651
           0.0036        500.123      0.0235605           6992           1509          12063
           0.0036        506.888      0.0242324           8986           1552          12407
           0.0036        377.962       0.024418           7005           1562          12502
           0.0036        583.828      0.0241172           7904           1544          12348
           0.0036        448.863      0.0242837           6839           1529          12239
           0.0036         485.34      0.0247402           8078           1584          12667
           0.0036        430.312      0.0248184           8581           1588          12707
           0.0036        476.053       0.024256           7036           1529          12225
           0.0036        481.853      0.0247109           7177           1582          12652
           0.0036          511.7      0.0246567           6319           1553          12427
           0.0036        439.118      0.0247852           7198           1587          12690
           0.0036        379.665       0.024916           7731           1594          12757
];

rows = size(data, 1);
cols = size(data, 2);

data_delay = [];
for i = 1:rows/20,
   ifirst = (i - 1) * 20 + 1;
   ilast  = ifirst + 20 - 1;
   tmp = data(ifirst:ilast, cols-5+1);
   avg = mean(tmp);
   [h sig ci] = ttest(tmp, 0.1);
   ci = (ci(2)-ci(1))/2;
   data_delay = [data_delay; data(ifirst, 1:cols-5), avg ci];
end

figure(1);
hold on;
plot(data_delay(:,1), data_delay(:,2), symbol);

data_throughput = [];
for i = 1:rows/20,
   ifirst = (i - 1) * 20 + 1;
   ilast  = ifirst + 20 - 1;
   tmp = data(ifirst:ilast, cols-5+2);
   avg = mean(tmp);
   [h sig ci] = ttest(tmp, 0.1);
   ci = (ci(2)-ci(1))/2;
   data_throughput = [data_throughput; data(ifirst, 1:cols-5), avg ci];
end

figure(2);
hold on;
plot(data_throughput(:,1), data_throughput(:,2), symbol);

data_maxdelay = [];
for i = 1:rows/20,
   ifirst = (i - 1) * 20 + 1;
   ilast  = ifirst + 20 - 1;
   tmp = data(ifirst:ilast, cols-5+3);
   avg = mean(tmp);
   [h sig ci] = ttest(tmp, 0.1);
   ci = (ci(2)-ci(1))/2;
   data_maxdelay = [data_maxdelay; data(ifirst, 1:cols-5), avg ci];
end

figure(3);
hold on;
plot(data_maxdelay(:,1), data_maxdelay(:,2), symbol);


%-------- Saturation Analysis -----------
slope=[];
for i=2:size(data_throughput,1),
    slope(i-1) = (data_throughput(i,2)-data_throughput(i-1,2))/(data_throughput(i,1)-data_throughput(i-1,1));
end

for i=2:size(slope,2),
    if slope(i) < (0.95*mean(slope(1:i)))
        max_pir = data_throughput(i, 1);
        max_throughput = data_throughput(i, 2);
        min_delay = data_delay(i, 2);
        break;
    end
end
